import javax.servlet.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;

public class MyServlet implements Servlet {
    @Override
    public void init(ServletConfig servletConfig) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        servletResponse.setContentType("text/html;charset=utf-8");
        //servletResponse.setCharacterEncoding("UTF-8");
        PrintWriter out = servletResponse.getWriter();
        out.println("这是我们的Servlet页面，Hello！！！");
        Map<String, String[]> parameterMap = servletRequest.getParameterMap();
        System.out.println(parameterMap);
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
